﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Compilex.BaseLibrary;
using Compilex.Lexer.Automata;

namespace Compilex.Automata
{
    public class OperatorTokenRecognizer : TokenRecognizer
    {
        public Operator Operator { get; private set; }
        public OperatorTokenRecognizer(Operator _operator)
            : base(new OperatorDFA(_operator.lexeme), null)
        {
            this.Operator = _operator;
        }

        public override Token GetLastToken(SimpleHashtable<string, WordToken> words)
        {
            return new OperatorToken(Operator.tokenName);
        }
    }
}
